package br.com.tas.model;

import java.io.Serializable;

import br.com.tas.model.interfaces.IBaseBean;

public class CoordinatesBean implements IBaseBean, Serializable {

	private static final long serialVersionUID = 3537401029457928759L;
	
	private int _id;
	private String profile;
	private String address;
	private String latitude;
	private String longitude;
	
	public static final String ID = "_id";
	public static final String LATITUDE = "latitude";
	public static final String LONGITUDE = "longitude";
	public static final String ADDRESS = "address";
	public static final String PROFILE = "profile";
	
	public CoordinatesBean () {}

	public CoordinatesBean(int _id, String latitude, String longitude,
			String address, String profile) {
		super();
		this._id = _id;
		this.latitude = latitude;
		this.longitude = longitude;
		this.address = address;
		this.profile = profile;
	}
	
	public int get_id() {
		return _id;
	}

	public void set_id(int _id) {
		this._id = _id;
	}

	public String getProfile() {
		return profile;
	}

	public void setProfile(String profile) {
		this.profile = profile;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + _id;
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result
				+ ((latitude == null) ? 0 : latitude.hashCode());
		result = prime * result
				+ ((longitude == null) ? 0 : longitude.hashCode());
		result = prime * result + ((profile == null) ? 0 : profile.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CoordinatesBean other = (CoordinatesBean) obj;
		if (_id != other._id)
			return false;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (latitude == null) {
			if (other.latitude != null)
				return false;
		} else if (!latitude.equals(other.latitude))
			return false;
		if (longitude == null) {
			if (other.longitude != null)
				return false;
		} else if (!longitude.equals(other.longitude))
			return false;
		if (profile == null) {
			if (other.profile != null)
				return false;
		} else if (!profile.equals(other.profile))
			return false;
		return true;
	}

	@Override
	public String tableName() {
		return "Coordinates";
	}
	
	@Override
	public String primaryKeyName() {
		return ID;
	}

	@Override
	public String[] columnName() {
		String[] columnName = {ID, PROFILE, ADDRESS, LATITUDE, LONGITUDE};
		return columnName;
	}

	@Override
	public long getId() {
		return this._id;
	}
}
